//
//  KBbsTopicsDetailRequest.m
//  Keping
//
//  Created by a on 2017/9/27.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "KBbsTopicsDetailRequest.h"

@implementation KBbsTopicsDetailRequest
{
    NSString* _requestUrl;
}

-(instancetype)initWithTopicId:(NSString *)topicId
{
    if (![topicId isNotBlank]) return nil;
    if (self == [super init]) {
        NSString* url = [NSString stringWithFormat:@"%@",KAnnouncementDetailURL];
        if ([url containsString:@"topicId"]) {
            url = [url stringByReplacingOccurrencesOfString:@"topicId" withString:topicId];
        }
        _requestUrl = url;
    }
    
    return self;
}


-(NSString *)requestUrl
{
    return _requestUrl;
}
-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end

@implementation KBbsGeneralDetailRequest

-(NSString *)requestUrl
{
    return KBbsPostssListURL;
}
-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}


-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation KBbsGeneralCommentsRequest

-(NSString *)requestUrl
{
    return KBbsPostssListPostsURL;
}
-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation kBbsGeneralAndPost

-(NSString *)requestUrl
{
    return KAddCommunityStatusCommentURL;
}
-(KRequestMethod)requestMethod
{
    return KRequestMethodPOST;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation kBbsGeneralCommentsDetailRequest
{
    NSString* _requestUrl;
}

-(instancetype)initWithBbspostId:(NSString *)bbspostId
{
    if (![bbspostId isNotBlank])
        return nil;
    if (self == [super init]) {
        NSString* url = [NSString stringWithFormat:@"%@",KBbsPostssCommentsDetailPostsURL];
        if ([url containsString:@"{bbspostId}"]) {
            url = [url stringByReplacingOccurrencesOfString:@"{bbspostId}" withString:bbspostId];
        }
        _requestUrl = url;
    }
    
    return self;
}

-(NSString *)requestUrl
{
    return _requestUrl;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end

@implementation kBbsGeneralDetailZanRequest
-(NSString *)requestUrl
{
    return KPraiseURL;
}
-(KRequestMethod)requestMethod
{
    return KRequestMethodPOST;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}
@end




